package com.joysuch.wwyt.attendance.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.joysuch.wwyt.attendance.bo.AttendanceApiBatchUserBo;
import com.joysuch.wwyt.attendance.bo.AttendanceApiUserBo;
import com.joysuch.wwyt.attendance.entity.AttendanceUser;
import com.joysuch.wwyt.core.entity.BaseUser;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author zqw
 * @since 2022-03-03
 */
public interface AttendanceUserMapper extends BaseMapper<AttendanceUser> {

    List<AttendanceUser> getUsersByGroupIds(@Param("groupIds")List<Long> groupIds, int year, int month);

    List<AttendanceUser> getRemainingThisMonth(Long groupId, Integer year, Integer month, Integer day,Long userId);

    List<AttendanceUser> selectByStaffsAndGroupIdAndYearAndMonth(@Param("resultUserIds")List<Long> resultUserIds, Long groupId, Integer year, Integer month);

    List<AttendanceUser> selectUsersByGroupIdAndYearAndMonth(Long groupId, int year, int month);

    List<AttendanceUser> selectOtherUsersByGroupIdAndYearAndGEMonth(Long groupId, int year, int month);

    List<AttendanceUser> selectOtherUsersByGroupIdAndGTYear(Long groupId, int year);

    List<AttendanceUser> selectUsersByDayAndUserId(Long groupId, Integer year, Integer month, Integer day, Long userId);

    List<AttendanceUser> selectByGroupIdAndYearAndMonthAndUserNameAndDepartId(Long groupId, Integer year, Integer month, String userName, Long departId);

    List<AttendanceApiUserBo> selectApiUsers(@Param("userIds")List<Long> userIds, int year, int month, int day, Integer crossdayFlag);

    List<BaseUser> getAttendanceOldUserByGroupAndYearAndMonth(Long groupId, int year, int month);

    List<AttendanceApiBatchUserBo> selectApiBatchUser(@Param("userList")List<Long> userList, @Param("yearList")List<Integer> yearList, @Param("monthList") List<Integer> monthList, @Param("dayList")List<Integer> dayList);
}
